<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>LocalStorage</title>
    <script type="text/javascript">
        function storageInf() {
            if(!window.localStorage){
                alert("浏览器支持localstorage");
            }else{
                var storage=window.localStorage;
                var k = "data"+0;
                storage.setItem('data0',"heoo")
                console.log(storage.getItem(k));
                //将JSON字符串转换成为JSON对象输出
                var js=storage.getItem(k);
                console.log(js.parse)
            }
        }
        storageInf()

    </script>
</head>

<body>
<div id="text">gagag</div>

</body>
</html>